import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Button',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyStatelessWidget(),
    );
  }
}

class MyStatelessWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    //定义文本样式

    return Scaffold(
      appBar: AppBar(
        title: Text("Button"),
      ),
      //从子到父响应，没有组织冒泡响应功能
      body: GestureDetector(
        //单击
        onTap: (){
          print("Tap");
        },
        //双击
        onDoubleTap: (){
          print("double tap");
        },
        //长按
        onLongPress: (){
          print("LongPress");
        },
        //拖动
        onHorizontalDragStart: (e){
          print("onHorizontalDragStart:");
          print(e);
        },
        //缩放
        onScaleUpdate: (e){
          print("onScaleUpdate");
          print(e);
        },
        child: Container(
          width: 200,
          height: 200,
          color: Colors.pink
        ),
      )
    );
  }

}
